package edu.java.homework.hw10.stack;

import java.util.Scanner;

public class TestStack {

    public static void main(String[] args) {

	FixedSizeStack fss = StackFactory.instance().createFixedSizeStack();

	System.out.println("Look at the legend with operations. "
		+ "When you need a specific operation, "
		+ "please enter the corresponding number."
		+ "\nIf you want to stop the program, please enter 0.");
	System.out.println("Stop=0, Push=1, Pop=2, Peek=3");

	Scanner input = new Scanner(System.in);
	int chosenOperation = -1;

	do {
	    System.out.print("Operation: ");
	    chosenOperation = input.nextInt();
	    switch (chosenOperation) {
	    case 1: {
		fss.push(new Object());
		break;
	    }
	    case 2: {
		fss.pop();
		break;
	    }
	    case 3: {
		fss.peek();
		break;
	    }

	    }
	} while (chosenOperation != 0);

	if (input != null) {
	    input.close();
	}
    }

}
